package com.superjson.showpro.entity;

import com.superjson.showpro.base.BaseObj;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import nl.bitwalker.useragentutils.BrowserType;
import nl.bitwalker.useragentutils.OperatingSystem;

import javax.persistence.*;
import java.io.Serializable;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@Table(name = "sp_system_record")
public class SystemRecord extends BaseObj implements Serializable{

    private static final long serialVersionUID = 8314500634029986389L;
    /**
     * ip地址
     */
    @Column(name = "ip")
    private String ip;

    /**
     * 用户
     */
    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    /**
     * 浏览器名称
     */
    @Column(name = "browser_name")
    private String browserName;

    /**
     * 浏览器类型
     */
    @Enumerated(EnumType.STRING)
    @Column(name = "browser_type")
    private BrowserType browserType;

    /**
     * 浏览器版本号
     */
    @Column(name = "browser_version")
    private String browserVersion;

    /**
     * 操作系统
     */
    @Enumerated(EnumType.STRING)
    @Column(name = "operating_system")
    private OperatingSystem operatingSystem;

}